package com.xiexin.setmealinfo.service.impl;

import com.xiexin.setmealinfo.domain.SetmealInfo;
import com.xiexin.setmealinfo.mapper.SetmealInfoMapper;
import com.xiexin.setmealinfo.service.ISetmealInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 套餐的信息Service业务层处理
 * 
 * @author xiexin
 * @date 2022-03-26
 */
@Service
public class SetmealInfoServiceImpl implements ISetmealInfoService 
{
    @Autowired
    private SetmealInfoMapper setmealInfoMapper;

    /**
     * 查询套餐的信息
     * 
     * @param id 套餐的信息主键
     * @return 套餐的信息
     */
    @Override
    public SetmealInfo selectSetmealInfoById(Long id)
    {
        return setmealInfoMapper.selectSetmealInfoById(id);
    }

    /**
     * 查询套餐的信息列表
     * 
     * @param setmealInfo 套餐的信息
     * @return 套餐的信息
     */
    @Override
    public List<SetmealInfo> selectSetmealInfoList(SetmealInfo setmealInfo)
    {
        return setmealInfoMapper.selectSetmealInfoList(setmealInfo);
    }

    /**
     * 新增套餐的信息
     * 
     * @param setmealInfo 套餐的信息
     * @return 结果
     */
    @Override
    public int insertSetmealInfo(SetmealInfo setmealInfo)
    {
        return setmealInfoMapper.insertSetmealInfo(setmealInfo);
    }

    /**
     * 修改套餐的信息
     * 
     * @param setmealInfo 套餐的信息
     * @return 结果
     */
    @Override
    public int updateSetmealInfo(SetmealInfo setmealInfo)
    {
        return setmealInfoMapper.updateSetmealInfo(setmealInfo);
    }

    /**
     * 批量删除套餐的信息
     * 
     * @param ids 需要删除的套餐的信息主键
     * @return 结果
     */
    @Override
    public int deleteSetmealInfoByIds(Long[] ids)
    {
        return setmealInfoMapper.deleteSetmealInfoByIds(ids);
    }

    /**
     * 删除套餐的信息信息
     * 
     * @param id 套餐的信息主键
     * @return 结果
     */
    @Override
    public int deleteSetmealInfoById(Long id)
    {
        return setmealInfoMapper.deleteSetmealInfoById(id);
    }

    public List<Map<String, Object>> findSetmealCount() {
        return setmealInfoMapper.findSetmealCount();
    }
}
